<?php
define('API_KEY','Hdkfd7293cvdsU8w2d');
if(isset($_REQUEST['sid']))
	$_COOKIE[session_name()] = $_REQUEST['sid'];

define("APP_PATH",dirname(__FILE__));
define("SP_PATH",dirname(__FILE__).'/SpeedPHP');
require(APP_PATH.'/config/config.enviroment.php');
require(APP_PATH.'/config/config.consts.php');
$spConfig = array(
	"db" => array( //database config
		'host' => DB_HOST_NAME,
		'login' => DB_USER_NAME,
		'password' => DB_USER_PASSWORD,
		'database' => DB_DATABASE_NAME,
		'prefix' => DB_DATABASE_TABLE_PREFIX,
	),
		/*
	'view' => array(
		'enabled' => FALSE // enable template feature
	),
	*/
	'launch' => array( 
		 'router_prefilter' => array( 
			array('spAcl','maxcheck') // max privilege check
		 )
	 ),
	 'ext' => array( // extension settings
	 	'spAcl' => array( // acl	 
	 		// If don't granted privilege call function 
	 		'prompt' => array("model_user", "apiacljump"),
	 	), 
	 ),
	 'global_admin_acl'=>'GBAPI',
	 'mode' => SITE_RUNNING_MODE
);
$_REQUEST['c'] = 'api_handler';
//$_REQUEST['a'] = $_REQUEST['action'];

require(SP_PATH."/SpeedPHP.php");
import(APP_PATH.'/controller/baseController.php');
import(APP_PATH.'/model/model_version.php');
import('class.sessionutil.php');
import('class.util.php');
import('class.des.php');



spRun();